<?php
    if($dowload){
        header('Content-Type: application/vnd.ms-excel');
        header('Content-Disposition: attachment;filename="'.$filename.'.xls"');
        header('Cache-Control: max-age=0');
        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
        $objWriter->save('php://output');
    }
    else{
    ?>
    <div id="left_nav" class="span3" style="padding: 0px;">
        <div id="nav_group" class="inner_shadow">
            <?php
            echo $this->element('bank/nav_branch_sup');
            ?>
        </div>
    </div>
    <div class="span8" style="padding:10px; background-color: #fff; min-height: 480px;">
        <h4>Transaction Reports</h4>
        <br />
        <?php
        echo $this->Message->msg('Notification','No new transactions to download.','warning', false);
        ?>
        <a href="<?php echo $this->Html->url(array('controller'=>'Bank','action' => 'reports')); ?>" class="btn btn-large" ><i class="icon-arrow-left"></i> Back To Reports </a>
        <br /><br />
    </div>
    <?php
    }
?>